<template>
	<view class="app">
		<image src="https://gnzxwylz.xlygrcw.com/upload/GNZX/home/20.png" mode="widthFix"></image>
		<view class="">
			<view class="item">
				<text>发布级别</text>
				<view class="" @tap="show = true">
					<text v-if="fromData.type.length > 0">{{ typeList[0][fromData.type[0]].cateName }}——{{ typeList[1][fromData.type[1]].cateName }}</text>
					<text v-else style="color: #c0c4cc;font-size: 24upx;">请选择</text>
				</view>
			</view>
			<view class="item">
				<text>发布渠道</text>
				<view class="" @tap="show = true">
					<text v-if="fromData.type.length > 0">{{ typeList[0][fromData.type[0]].cateName }}——{{ typeList[1][fromData.type[1]].cateName }}</text>
					<text v-else style="color: #c0c4cc;font-size: 24upx;">请选择</text>
				</view>
			</view>
			<view class="item">
				<text>发布类型</text>
				<view class="" @tap="show = true">
					<text v-if="fromData.type.length > 0">{{ typeList[0][fromData.type[0]].cateName }}——{{ typeList[1][fromData.type[1]].cateName }}</text>
					<text v-else style="color: #c0c4cc;font-size: 24upx;">请选择</text>
				</view>
			</view>
			<view class="item" style="display: block;border-bottom: 0;">
				<text>文稿标题</text>
				<view class="" style="padding: 20upx;background: #F9F9F9;margin-top: 20upx;"><u-input v-model="fromData.name" type="textarea" input-align="left" :clearable="false" placeholder="请输入信息" /></view>
			</view>
			<view class="item" style="display: block;border-bottom: 0;">
				<text>文稿链接</text>
				<view class="" style="padding: 20upx;background: #F9F9F9;margin-top: 20upx;"><u-input v-model="fromData.name" type="textarea" input-align="left" :clearable="false" placeholder="请输入信息" /></view>
			</view>
		</view>
		<view class="btn"><text>提交</text></view>
		<u-picker mode="multiSelector" v-model="show" :range="typeList" range-key="cateName" @confirm="onConfirm"></u-picker>
	</view>
</template>

<script>
export default {
	data() {
		return {
			fromData: {
				type: []
			},
			show: false,
			typeList: [
				[
					{
						cateName: '他的',
						id: 1
					},
					{
						cateName: '水电费',
						id: 2
					},
					{
						cateName: '电饭锅',
						id: 3
					}
				],
				[
					{
						cateName: '电饭电饭锅',
						id: 4
					},
					{
						cateName: '结核杆菌',
						id: 5
					},
					{
						cateName: '电饭锅',
						id: 7
					}
				]
			],
		};
	},
	methods: {
		onConfirm(e) {
			const index1 = e[0] || 0;
			const index2 = e[1] || 0;
			this.fromData.type = [index1, index2];
			console.log(this.fromData.type);
		},
		radioChange(e) {
			console.log(e);
		}
	}
};
</script>

<style lang="scss">
@import './wengaofabu.scss';
</style>
